﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Controls;

namespace CPETwit.WPFClient.Converter
{
    public class SexConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is string)
            {
                string sex = value as string;
                if (sex == "M") 
                    return "Homme";
                if (sex == "F")
                    return "Femme";
            }
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is string)
            {
                string sex = value as string;
                if (sex == "Homme") return "M";
                if (sex == "Femme") return "F";
            }
            return null;
        }
    }
}
